package com.service.impl;

import com.dao.UserDao;
import com.dao.UserDaoImpl;
import com.domain.UserEntity;
import com.service.StudentService;

import java.util.List;

public class StudentServiceImpl implements StudentService {

	UserDao studentDao = new UserDaoImpl();

	@Override
	public List getAllStudents() {
		return studentDao.getAll();
	}

	@Override
	public UserEntity login(int sno, String pwd) {
		return studentDao.getStudent(sno, pwd);
	}

    @Override
    public boolean register(UserEntity userEntity) {
        return studentDao.saveStudent(userEntity)>0;
    }

	@Override
	public void updatePassword(int userId, String pwd) {
		studentDao.updatePassword(userId, pwd);
	}

}
